<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台（PHP版）
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码，建议反馈是我们前进的动力
// | 开源版本可自由商用，可去除界面版权logo
// | gitee下载：https://gitee.com/likeshop_gitee/likeadmin
// | github下载：https://github.com/likeshop-github/likeadmin
// | 访问官网：https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------

namespace app\adminapi\validate\bookdata;


use app\common\validate\BaseValidate;


/**
 * Bookdata验证器
 * Class BookdataValidate
 * @package app\adminapi\validate
 */
class BookdataValidate extends BaseValidate
{

     /**
      * 设置校验规则
      * @var string[]
      */
    protected $rule = [
        'id' => 'require',
        'platform' => 'require',
        'promotion_link_id' => 'require',
        'admin_id' => 'require',
        'date' => 'require',
        'book_id' => 'require',
        'readnum' => 'require',
        'number_of_readers' => 'require',
        'consumer_amount' => 'require',
        'consumer_users' => 'require',
        'payment_users' => 'require',
        'payment_num' => 'require',
        'payment_amount' => 'require',
        'consumption_rate' => 'require',
        'payment_rate' => 'require',
        'per_capita_consumption_amount' => 'require',
        'per_capita_payment_amount' => 'require',
        'per_capita_recharge_frequency' => 'require',
        'per_capita_reading_frequency' => 'require',
    ];


    /**
     * 参数描述
     * @var string[]
     */
    protected $field = [
        'id' => 'id',
        'platform' => '快应用ID',
        'promotion_link_id' => '推广链ID',
        'admin_id' => '管理员ID',
        'date' => '日期',
        'book_id' => '书籍ID',
        'readnum' => '阅读次数',
        'number_of_readers' => '阅读人数',
        'consumer_amount' => '支付金额',
        'consumer_users' => '消费用户',
        'payment_users' => '充值人数',
        'payment_num' => '充值次数',
        'payment_amount' => '充值金额',
        'consumption_rate' => '消费率',
        'payment_rate' => '付费率',
        'per_capita_consumption_amount' => '人均消费金额',
        'per_capita_payment_amount' => '人均充值金额',
        'per_capita_recharge_frequency' => '人均充值次数',
        'per_capita_reading_frequency' => '人均阅读次数',
    ];


    /**
     * @notes 添加场景
     * @return BookdataValidate
     * @author likeadmin
     * @date 2024/06/18 15:02
     */
    public function sceneAdd()
    {
        return $this->only(['platform','promotion_link_id','admin_id','date','book_id','readnum','number_of_readers','consumer_amount','consumer_users','payment_users','payment_num','payment_amount','consumption_rate','payment_rate','per_capita_consumption_amount','per_capita_payment_amount','per_capita_recharge_frequency','per_capita_reading_frequency']);
    }


    /**
     * @notes 编辑场景
     * @return BookdataValidate
     * @author likeadmin
     * @date 2024/06/18 15:02
     */
    public function sceneEdit()
    {
        return $this->only(['id','platform','promotion_link_id','admin_id','date','book_id','readnum','number_of_readers','consumer_amount','consumer_users','payment_users','payment_num','payment_amount','consumption_rate','payment_rate','per_capita_consumption_amount','per_capita_payment_amount','per_capita_recharge_frequency','per_capita_reading_frequency']);
    }


    /**
     * @notes 删除场景
     * @return BookdataValidate
     * @author likeadmin
     * @date 2024/06/18 15:02
     */
    public function sceneDelete()
    {
        return $this->only(['id']);
    }


    /**
     * @notes 详情场景
     * @return BookdataValidate
     * @author likeadmin
     * @date 2024/06/18 15:02
     */
    public function sceneDetail()
    {
        return $this->only(['id']);
    }

}